
import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class VendingMachineItemTest {

	//Some objects 
	VendingMachineItem item1;
	
	@Before
	public void setUp() throws Exception {
		item1 = new VendingMachineItem("item1", 2.0);
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test(expected=VendingMachineException.class)
	public void testNegativeMoneyException(){
		VendingMachineItem item2 = new VendingMachineItem("Illegal_Price", -1.0);
	}

	@Test
	public void testGetName() {
		//Test regular name
		assertEquals("item1", item1.getName());
	}

	@Test
	public void testGetPrice() {
		//test get price
		assertTrue(2.0 - item1.getPrice() == 0);
	}

}
